import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Random;

public class test {
    public static void orderArr(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] = i;
        }
    }
    public static void notOrderArr(int[] arr){
        for (int i = 0; i < arr.length; i++) {
            arr[i] = arr.length - i;
        }
    }
    public static void notOrderArrRandom(int[] arr){
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(100000);
        }
    }
    public static void testInserteSort(int[] arr){
        int tmparr[] = Arrays.copyOf(arr,arr.length);
        long stratTime = System.currentTimeMillis();
        Sort.insertSort(tmparr);
        long endTime = System.currentTimeMillis();
        System.out.println("插入排序耗时" + (endTime - stratTime));
    }
    public static void main1(String[] args) {
        int[] arr = {5, 3, 4, 6, 2};
        Sort.quickSort(arr);
        for (int num : arr) {
            System.out.print(num + " ");
        }
        System.out.println();
        int[] arr1 = new int[100000];
        notOrderArrRandom(arr1);
        testInserteSort(arr1);
    }

    public static void main(String[] args) {
        int[] arr1 = {5, 3, 4, 6, 2};
        //Sort.quickSort(arr);
        int[] arr2 = {28,16,32,12,60,2,5,72};
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
        System.out.println();
        //Sort.partition(arr2,0,arr2.length - 1);
        Sort.insertSort(arr2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.print(arr2[i] + " ");
        }
    }
}
